DEBUG = -O2
LIBS = -lm -lga -lmysqlpp
INCLUDES = -I/usr/local/include -I/usr/local/mysql/include
MISC = -Wall

all: main

main: main.o dbanalysis.o options.o configfile.o tablemapping.o timegenome.o
	g++ main.o dbanalysis.o options.o configfile.o tablemapping.o timegenome.o -o main $(LIBS) $(DEBUG)

main.o: general.h main.h main.cpp
	g++ -c main.cpp -o main.o $(MISC) $(INCLUDES) $(DEBUG)

dbanalysis.o: general.h dbanalysis.h dbanalysis.cpp
	g++ -c dbanalysis.cpp -o dbanalysis.o $(MISC) $(INCLUDES) $(DEBUG)

options.o: general.h options.h options.cpp
	g++ -c options.cpp -o options.o $(MISC) $(INCLUDES) $(DEBUG)

configfile.o: general.h configfile.h configfile.cpp
	g++ -c configfile.cpp -o configfile.o $(MISC) $(INCLUDES) $(DEBUG)

tablemapping.o: general.h tablemapping.h tablemapping.cpp structmapping.h
	g++ -c tablemapping.cpp -o tablemapping.o $(MISC) $(INCLUDES) $(DEBUG)

timegenome.o: general.h timegenome.h timegenome.cpp
	g++ -c timegenome.cpp -o timegenome.o $(MISC) $(INCLUDES) $(DEBUG)

clean:
	rm -rf *.o
	rm -rf main
	rm -rf *.*~
	